package com.example.administrator.k3xiangmu;

import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.AsyncTask;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.text.InputType;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.android.barcodescandemo.ScannerInerface;
import com.example.administrator.k3xiangmu.adapter.RukuAdapter;
import com.example.administrator.k3xiangmu.entity.CK;
import com.example.administrator.k3xiangmu.entity.KH;
import com.example.administrator.k3xiangmu.entity.RukuEntity;
import com.uuzuche.lib_zxing.activity.CaptureActivity;
import com.uuzuche.lib_zxing.activity.CodeUtils;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import de.greenrobot.event.EventBus;

public class Yidonkaidan2Activity extends AppCompatActivity {
    private Toolbar toolbar;
    ProgressDialog dialog;
    private String number = "";
    private String name = "";
    private String fsn = "";
    private RukuAdapter adapter;
    private Button bt;
    private String number2 = "";
    ListView lv;
    private List<RukuEntity> list = new ArrayList<>();
    private BroadcastReceiver mReceiver;
    private IntentFilter mFilter;
    ScannerInerface Controll = new ScannerInerface(this);
    private List<CK> listCK = new ArrayList<>();
    private double price = 0;
    private int pay = 0;
    private double money = 0;
    private double total = 0;
    private TextView tvrq, tvxj, tvmoney, tvnumber, zhifuname;
    private TextView etje;
    private String ckid = "";
    private String ckname = "";
    private List<KH> listkh = new ArrayList<>();
    private Button zhifu;
    private double p157 = 0;
    private double p158 = 0;
    private double p159 = 0;
    private double p160 = 0;
    private double p161 = 0;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_yidonkaidan2);
        EventBus.getDefault().register(this);
        Controll.open();
        Controll.setOutputMode(1);//使用广播模式
        mFilter = new IntentFilter("android.intent.action.SCANRESULT");
        mReceiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {

                // 此处获取扫描结果信息
                final String scanResult = intent.getStringExtra("value");
                Toast.makeText(Yidonkaidan2Activity.this, "解析结果:" + scanResult, Toast.LENGTH_LONG).show();
                String[] s = scanResult.split("\\[");

                number = s[0];
                fsn = s[1];
                // number = scanResult;
                getName();
            }
        };

        dialog = new ProgressDialog(this);
        setTool();
        setView();
        setListen();

    }

    private void setListen() {
        tvxj = (TextView) findViewById(R.id.tvxj);
        zhifu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent x = new Intent(Yidonkaidan2Activity.this, HuakaActivity.class);

                startActivityForResult(x, 66);
            }
        });
        tvxj.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                final String[] s = {"现金", "支付宝", "银行卡", "微信", "花卡"};
                AlertDialog ad = new AlertDialog.Builder(Yidonkaidan2Activity.this).setTitle("选择支付方式")
                        .setItems(s, new DialogInterface.OnClickListener() {

                            @Override
                            public void onClick(DialogInterface dialog, int which) {

                                tvxj.setText(s[which]);

                                switch (which) {
                                    case 0:
                                        pay = 0;
                                        etje.setFocusable(true);
                                        break;
                                    case 1:
                                        pay = 1;
                                        etje.setFocusable(true);
                                        break;
                                    case 2:
                                        pay = 2;
                                        etje.setFocusable(true);
                                        break;
                                    case 3:
                                        pay = 3;
                                        etje.setFocusable(true);
                                        break;
                                    case 4:
                                        pay = 4;
                                        etje.setFocusable(false);
                                        break;

                                }
                                dialog.dismiss();
                                if (which == 4) {
                                    Intent x = new Intent(Yidonkaidan2Activity.this, HuakaActivity.class);

                                    startActivityForResult(x, 66);

                                }

                            }
                        }).create();
                ad.show();
            }
        });


        bt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (list.size() == 0) {
                    Toast.makeText(Yidonkaidan2Activity.this, "订单不能为空", Toast.LENGTH_SHORT).show();
                } else {
                    UpdateTextTask3 updateTextTask = new UpdateTextTask3(Yidonkaidan2Activity.this);
                    updateTextTask.execute();
                }
            }
        });
    }

    private void setView() {
        zhifu = (Button) findViewById(R.id.zhifu);
        zhifuname = (TextView) findViewById(R.id.zhifuname);
        etje = (TextView) findViewById(R.id.et);
       // etje.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
        lv = (ListView) findViewById(R.id.lv);
        bt = (Button) findViewById(R.id.tj);
        adapter = new RukuAdapter(list, this);
        lv.setAdapter(adapter);
        tvrq = (TextView) findViewById(R.id.tv_rq);
        tvmoney = (TextView) findViewById(R.id.money);
        tvnumber = (TextView) findViewById(R.id.number);
        SimpleDateFormat dateFormatera = new SimpleDateFormat("yyyy-MM-dd");
        String date1a = dateFormatera.format(new Date());
        tvrq.setText(date1a);
    }

    private void setTool() {
        toolbar = (Toolbar) findViewById(R.id.id_toolbar);
        toolbar.setTitle("销售单");

        toolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
        setSupportActionBar(toolbar);


        toolbar.setNavigationIcon(android.R.drawable.ic_menu_revert);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(MenuItem item) {
                String msg = "";
                switch (item.getItemId()) {
                    case R.id.action_sm:
                        msg += "Click edit";
                        break;

                }

                if (!msg.equals("")) {
                    Toast.makeText(Yidonkaidan2Activity.this, msg, Toast.LENGTH_SHORT).show();
                    Intent intent = new Intent(Yidonkaidan2Activity.this, CaptureActivity.class);
                    startActivityForResult(intent, 111);

                }
                return true;

            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu, menu);//加载menu文件到布局
        return true;
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        if (requestCode == 111) {
            //处理扫描结果（在界面上显示）
            if (null != data) {
                Bundle bundle = data.getExtras();
                if (bundle == null) {
                    return;
                }
                if (bundle.getInt(CodeUtils.RESULT_TYPE) == CodeUtils.RESULT_SUCCESS) {
                    String result = bundle.getString(CodeUtils.RESULT_STRING);
                    Toast.makeText(this, "解析结果:" + result, Toast.LENGTH_LONG).show();
                    String[] s = result.split("\\[");

                    number = s[0];
                    fsn=s[1];
                    //number = result;
                    getName();

                } else if (bundle.getInt(CodeUtils.RESULT_TYPE) == CodeUtils.RESULT_FAILED) {
                    Toast.makeText(Yidonkaidan2Activity.this, "解析二维码失败", Toast.LENGTH_LONG).show();
                } else if (requestCode == 66) {
//                    Log.i("ssss", "**************");
//                    Bundle b = data.getExtras();
//                    listkh = (List<KH>) b.getSerializable("list");
//                    double t = 0;
//                    for (KH kk : listkh) {
//                        t += kk.getFk();
//                    }
//                    Log.i("ssss", t + "**************");
//                    etje.setText(t + "");

                }
            }
        } else if (requestCode == 66&&resultCode==55) {

            Bundle b = data.getExtras();
            listkh = (List<KH>) b.getSerializable("list");
            double t = 0;
            for (KH kk : listkh) {
                t += kk.getFk();
            }
            zhifuname.setText(b.getString("zhifu"));
            etje.setText(t + "");
        }
    }

    private void getName() {
        UpdateTextTask2 updateTextTask = new UpdateTextTask2(this);
        updateTextTask.execute();
    }

    class UpdateTextTask2 extends AsyncTask<Void, Integer, Integer> {
        private Context context;

        UpdateTextTask2(Context context) {
            this.context = context;
        }

        /**
         * 运行在UI线程中，在调用doInBackground()之前执行
         */
        @Override
        protected void onPreExecute() {

            dialog.show();
        }

        /**
         * 后台运行的方法，可以运行非UI线程，可以执行耗时的方法
         */
        @Override
        protected Integer doInBackground(Void... params) {

            try {

                Class.forName("net.sourceforge.jtds.jdbc.Driver");
                Connection dbConn = DriverManager.getConnection("jdbc:jtds:sqlserver://" + Main3Activity.ip + ";DatabaseName=" + Main3Activity.userDB + "",
                        Main3Activity.userName, Main3Activity.userPwd);
                testConnection2(dbConn);


            } catch (Exception e) {
                Log.i("asd", e.toString() + "");
                return 1;

            }


            return 5;
        }

        /**
         * 运行在ui线程中，在doInBackground()执行完毕后执行
         */
        @Override
        protected void onPostExecute(Integer integer) {
            dialog.dismiss();
            if (!name.equals("")) {
                LayoutInflater inflater = getLayoutInflater();
                View layout = inflater.inflate(R.layout.dialog, null);
               // final EditText et1 = (EditText) layout.findViewById(R.id.et1);
                final EditText et2 = (EditText) layout.findViewById(R.id.et2);

               // et1.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
                et2.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
                et2.setText(price + "");

                Button bt = (Button) layout.findViewById(R.id.bt_ck);
                final TextView tv = (TextView) layout.findViewById(R.id.tv_ck);
                bt.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {

                        getCK((Button) v);
                    }
                });


                new AlertDialog.Builder(Yidonkaidan2Activity.this).setTitle("请完成订单").setView(layout).setPositiveButton("确定", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                      //  String s1 = et1.getText().toString() + "";
                        String s2 = et2.getText().toString() + "";
                        String s3 = tv.getText().toString() + "";

//                        if (s1.equals("")) {
//                            Toast.makeText(Yidonkaidan2Activity.this, "数量不能为空", Toast.LENGTH_LONG).show();
//                            return;
//                        }

                        if (ckid.equals("")) {
                            Toast.makeText(Yidonkaidan2Activity.this, "仓库不能为空", Toast.LENGTH_LONG).show();
                            return;
                        }

                        RukuEntity e = new RukuEntity();
                        e.setNumber(1);
                        e.setName(name);
                        e.setId(number2);
                        e.setCkid(ckid);
                        e.setCkname(ckname);
                        e.setPrice(et2.getText().toString());
                        e.setFSN(fsn);
                        double p = Double.parseDouble(e.getPrice());
                        double t = e.getNumber();
                        for (RukuEntity en : list) {
                            if (en.getId().equals(e.getId())) {
                                double p2 = Double.parseDouble(en.getPrice());
                                double t2 =en.getNumber();
                                double p3 = Double.parseDouble(e.getPrice());
                                double x = p2 * t2;
                                double y = p3 * t2;
                                money = (money - p2 * t2 + p3 * t2 + p * t);
                                total += t;
                                tvmoney.setText(money + "");
                                tvnumber.setText(total + "");
                                en.setPrice(e.getPrice());
                                en.setNumber(e.getNumber() + en.getNumber());
                                en.setCkid(e.getCkid());
                                adapter.notifyDataSetChanged();


                                return;
                            }
                        }
                        money += p * t;
                        total += t;
                        tvmoney.setText(money + "");
                        tvnumber.setText(total + "");

                        list.add(e);
                        adapter.notifyDataSetChanged();
                        ckid = "";

                    }
                }).setNegativeButton("取消", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        ckid = "";
                    }
                }).show();
            } else {
                name = "";
                number = "";
                number2 = "";
                fsn = "";
            }

        }

        /**
         * 在publishProgress()被调用以后执行，publishProgress()用于更新进度
         */
        @Override
        protected void onProgressUpdate(Integer... values) {

        }
    }

    class UpdateTextTask3 extends AsyncTask<Void, Integer, Integer> {
        private Context context;

        UpdateTextTask3(Context context) {
            this.context = context;
        }

        /**
         * 运行在UI线程中，在调用doInBackground()之前执行
         */
        @Override
        protected void onPreExecute() {

            dialog.show();
        }

        /**
         * 后台运行的方法，可以运行非UI线程，可以执行耗时的方法
         */
        @Override
        protected Integer doInBackground(Void... params) {

            try {

                Class.forName("net.sourceforge.jtds.jdbc.Driver");
                Connection dbConn = DriverManager.getConnection("jdbc:jtds:sqlserver://" + Main3Activity.ip + ";DatabaseName=" + Main3Activity.userDB + "",
                        Main3Activity.userName, Main3Activity.userPwd);
                testConnection3(dbConn);


            } catch (Exception e) {
                Log.i("asd", e.toString() + "");
                return 1;

            }


            return 5;
        }

        /**
         * 运行在ui线程中，在doInBackground()执行完毕后执行
         */
        @Override
        protected void onPostExecute(Integer integer) {
            dialog.dismiss();
            if (integer == 5) {
                Toast.makeText(Yidonkaidan2Activity.this, "提交成功", Toast.LENGTH_LONG).show();
                list.clear();
                listkh.clear();
                zhifuname.setText("");
                money = 0;
                total = 0;
                tvmoney.setText(money + "");
                tvnumber.setText(total + "");
                etje.setText("0");
                adapter.notifyDataSetChanged();
            } else if (integer == 11) {
                Toast.makeText(Yidonkaidan2Activity.this, "花卡余额不足", Toast.LENGTH_LONG).show();
            }

            //

//            Toast.makeText(Yidonkaidan2Activity.this, "提交成功", Toast.LENGTH_LONG).show();
//            //lear();
//            list.clear();

        }

        /**
         * 在publishProgress()被调用以后执行，publishProgress()用于更新进度
         */
        @Override
        protected void onProgressUpdate(Integer... values) {

        }
    }

    public void testConnection2(Connection con) throws java.sql.SQLException {

        try {

            String sql = "select * from t_icitem where FNumber='" + number + "'";

            Statement stmt = con.createStatement();// 创建Statement
            ResultSet rs = stmt.executeQuery(sql);// ResultSet类似Cursor


            while (rs.next()) {// <code>ResultSet</code>最初指向第一行
                name = rs.getString("FName");
                number2 = rs.getString("FItemID");
                price = rs.getDouble("FSalePrice");
            }


            rs.close();
            stmt.close();
        } catch (SQLException e) {

            Log.i("ssss", e.toString());
            Toast.makeText(Yidonkaidan2Activity.this, "连接数据库失败", Toast.LENGTH_LONG).show();


        } finally {
            //Toast.makeText(MainActivity.this,ss, Toast.LENGTH_LONG).show();
            if (con != null)
                try {
                    con.close();
                } catch (SQLException e) {
                }
        }
    }

    private String getSql2(KH kh) {
        String sql = "select* from t_bos200000006entry2 where ftext='" + kh.getNo() + "'";
        return sql;
    }

    private String getSql(KH kh) {
        String sql = "update t_bos200000006entry2 set FDecimal=FDecimal-" + (kh.getFk() + "") + " where ftext='" + kh.getNo() + "'";
        return sql;
    }

    public int testConnection3(Connection con) throws java.sql.SQLException {
        CallableStatement callStmt = null;
        CallableStatement callStmt2 = null;
        Statement stmt3 = con.createStatement();
        Statement stmt4 = con.createStatement();
        for (KH k : listkh) {
            switch (k.getStatus()) {
                case 157:
                    p157 += k.getFk();
                    break;
                case 158:
                    p158 += k.getFk();
                    break;
                case 159:
                    p159 += k.getFk();
                    break;
                case 160:
                    p160 += k.getFk();
                    break;
                case 161:
                    p161 += k.getFk();
                    break;
            }

        }
        try {

            callStmt = con.prepareCall("{call [x_chuku5] (?,?,?,?,?,?,?,?,?,?)}");
            callStmt2 = con.prepareCall("{call [x_chuku4] (?,?,?,?)}");

            if (pay == 4) {
                for (KH k : listkh) {

                    String s2 = getSql2(k);
                    ResultSet resultSet = stmt3.executeQuery(s2);
                    while (resultSet.next()) {
                        if (resultSet.getDouble("FDecimal") < k.getFk()) {
                            Log.i("dddd", "ddddddddddddddddd");
                            //Toast.makeText(RukuActivity.this, k.getNo() + "余额不足", Toast.LENGTH_LONG).show();
                            return 11;
                        }
                    }


                }
                for (KH k : listkh) {
                    String s = getSql(k);
                    String s2 = getSql2(k);
                    //ResultSet resultSet = stmt3.executeQuery(s2);
                    stmt3.executeUpdate(s);
                }
            }
            for (RukuEntity e:list){
                String s="INSERT INTO dbo.z_xlh_xq ( FSN, status)VALUES  ( '"+e.getFSN()+"','移动开单' )";
                stmt4.execute(s);
            }
            for (int i = 0; i < list.size(); i++) {
                if (i == 0) {

                    callStmt.setString(1, list.get(i).getName());
                    callStmt.setString(2, list.get(i).getNumber()+"");
                    callStmt.setDouble(3, Double.parseDouble(list.get(i).getPrice()));
                    callStmt.setString(4, list.get(i).getCkid());
                    Log.i("aaa",Double.parseDouble(list.get(i).getPrice())+ "++++++++++++++++");
                    callStmt.setString(5, zhifuname.getText().toString());
                    callStmt.setDouble(6, p157);
                    callStmt.setDouble(7, p158);
                    callStmt.setDouble(8, p159);
                    callStmt.setDouble(9, p160);
                    callStmt.setDouble(10, p161);
                    callStmt.execute();
                } else {
                    callStmt2.setString(1, list.get(i).getName());
                    callStmt2.setString(2, list.get(i).getNumber()+"");
                    callStmt2.setDouble(3, Double.parseDouble(list.get(i).getPrice()));
                    Log.i("aaa",Double.parseDouble(list.get(i).getPrice())+ "**************");
                    callStmt2.setString(4, list.get(i).getCkid());

                    callStmt2.execute();
                }
            }
            return 5;

        } catch (SQLException e) {
            Log.i("aaa", e.toString());
            return 1;
        } finally {
            if (null != callStmt) {
                callStmt.close();
                callStmt2.close();
                stmt4.close();
                stmt3.close();
            }
            //Toast.makeText(MainActivity.this,ss, Toast.LENGTH_LONG).show();
            if (con != null)
                try {
                    con.close();
                } catch (SQLException e) {
                }
        }
    }

    private BroadcastReceiver MsgReceiver = new BroadcastReceiver() {

        @Override
        public void onReceive(Context context, Intent intent) {
            // TODO Auto-generated method stub
            String action = intent.getAction();
            System.out.print(action);
            //android.intent.action.SCANRESULT
            if (action.equals("android.intent.action.SCANRESULT")) {
                String mMsg = intent.getStringExtra("value");


                Toast.makeText(Yidonkaidan2Activity.this, "解析结果:" + mMsg, Toast.LENGTH_LONG).show();
                number = mMsg;
                getName();


            }

        }
    };

    @Override
    protected void onResume() {
        super.onResume();
        registerReceiver(mReceiver, mFilter);
    }

    @Override
    protected void onPause() {
        // 注销获取扫描结果的广播
        this.unregisterReceiver(mReceiver);
        super.onPause();
    }

    @Override
    protected void onDestroy() {
        mReceiver = null;
        mFilter = null;

        Controll.close();

        super.onDestroy();
    }

    private void getCK(Button v) {
        UpdateTextTask4 updateTextTask = new UpdateTextTask4(this, v);
        updateTextTask.execute();

    }

    class UpdateTextTask4 extends AsyncTask<Void, Integer, Integer> {
        private Context context;
        private Button v;

        UpdateTextTask4(Context context, Button v) {
            this.context = context;
            this.v = v;
        }

        /**
         * 运行在UI线程中，在调用doInBackground()之前执行
         */
        @Override
        protected void onPreExecute() {

            dialog.show();
        }

        /**
         * 后台运行的方法，可以运行非UI线程，可以执行耗时的方法
         */
        @Override
        protected Integer doInBackground(Void... params) {

            try {

                Class.forName("net.sourceforge.jtds.jdbc.Driver");
                Connection dbConn = DriverManager.getConnection("jdbc:jtds:sqlserver://" + Main3Activity.ip + ";DatabaseName=" + Main3Activity.userDB + "",
                        Main3Activity.userName, Main3Activity.userPwd);
                testConnection4(dbConn);


            } catch (Exception e) {
                Log.i("asd", e.toString() + "");
                return 1;

            }


            return 5;
        }

        /**
         * 运行在ui线程中，在doInBackground()执行完毕后执行
         */
        @Override
        protected void onPostExecute(Integer integer) {
            dialog.dismiss();
            if (listCK.size() > 0) {
                final String[] s = new String[listCK.size()];
                for (int i = 0; i < listCK.size(); i++) {
                    s[i] = listCK.get(i).getFName();
                }
                AlertDialog ad = new AlertDialog.Builder(context).setTitle("选择仓库")
                        .setItems(s, new DialogInterface.OnClickListener() {

                            @Override
                            public void onClick(DialogInterface dialog, int which) {

                                //tvxj.setText(s[which]);
//                                list.get(p).setCk(s[which]);
//                                notifyDataSetChanged();
                                ckid = listCK.get(which).getFItemID();
                                ckname = listCK.get(which).getFName();
                                v.setText(ckname);
                            }
                        }).create();
                ad.show();
            }
//

//            list.clear();
//            adapter.notifyDataSetChanged();
        }

        /**
         * 在publishProgress()被调用以后执行，publishProgress()用于更新进度
         */
        @Override
        protected void onProgressUpdate(Integer... values) {

        }
    }

    public void testConnection4(Connection con) throws java.sql.SQLException {
        CallableStatement callStmt = null;
        CallableStatement callStmt2 = null;
        try {
            listCK.clear();
            //
            String sql = "select * from t_Stock";

            Statement stmt = con.createStatement();// 创建Statement
            ResultSet rs = stmt.executeQuery(sql);// ResultSet类似Cursor


            while (rs.next()) {// <code>ResultSet</code>最初指向第一行
                CK entity = new CK();
                entity.setFItemID(rs.getString("FItemID"));
                entity.setFName(rs.getString("FName"));

                listCK.add(entity);


            }


            rs.close();
            stmt.close();


        } catch (SQLException e) {


        } finally {
            if (null != callStmt) {
                callStmt.close();
                callStmt2.close();
            }
            //Toast.makeText(MainActivity.this,ss, Toast.LENGTH_LONG).show();
            if (con != null)
                try {
                    con.close();
                } catch (SQLException e) {
                }
        }
    }

    public void onEventMainThread(RukuEntity e) {

        double p = Double.parseDouble(e.getPrice());
        double t = e.getNumber();
        money -= p * t;
        total -= t;
        tvmoney.setText(money + "");
        tvnumber.setText(total + "");
    }


}
